package com.data.basic.chapter12;

import com.data.basic.chapter07.MyMap;

/**基于AVL树的集合
 * @author wang on 2018/7/5.
 */
public class AVLMap<K extends Comparable<K>,V> implements MyMap<K,V> {

    private AVLTree<K,V> avl;

    public AVLMap() {
        this.avl = new AVLTree<>();
    }


    @Override
    public void add(K k, V v) {
        avl.add(k,v);

    }

    @Override
    public V remove(K k) {
        return remove(k);
    }

    @Override
    public boolean contains(K k) {
        return avl.contains(k);
    }

    @Override
    public V get(K k) {
        return avl.get(k);
    }

    @Override
    public void set(K k, V v) {
        avl.set(k,v);

    }

    @Override
    public int getSize() {
        return avl.getSize();
    }

    @Override
    public boolean isEmpty() {
        return avl.isEmpty();
    }
}
